package logic

import (
	"context"
	"cp/models/mysql"

	"cp/cprpc/cprpc"
	"cp/cprpc/internal/svc"

	"github.com/zeromicro/go-zero/core/logx"
)

type EvaluationListLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewEvaluationListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *EvaluationListLogic {
	return &EvaluationListLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *EvaluationListLogic) EvaluationList(in *cprpc.EvaluationListRequest) (*cprpc.EvaluationListResponse, error) {
	// todo: add your logic here and delete this line
	type eval []mysql.Evaluation
	mysql.DB.Debug().Find(&eval{}).Order("created_at")

	return &cprpc.EvaluationListResponse{}, nil
}
